<template>
  <div>
    <a-form-model-item label="用户ID">
      <a-input v-model="form.id" placeholder="请输入要删除的用户ID" />
    </a-form-model-item>
    <a-form-model-item :wrapper-col="buttonItemLayout.wrapperCol">

      <a-button type="danger" @click="del(form.id)">
        删&emsp;除
      </a-button>

    </a-form-model-item>
  </div>

</template>

<script>
export default {
name: "del_user",
  data(){
  return{
    form:{
      id:'',
    }
  }
  },
  computed:{
    buttonItemLayout() {
      const { layout } = this.form;
      return layout === "horizontal"
        ? {
          wrapperCol: { span: 14, offset: 4 },
        }
        : {};
    },
  },
  methods:{
    del(id){
      this.$axios.delete('/z/user/?id='+id)
        .then(res=>{
          alert(res.data.msg)
          console.log(res.data)
        })
    }
  }
}
</script>

<style scoped>

</style>
